local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)

function onGetFormulaValues(cid, level, maglevel)
	local min = ((level/5)+(maglevel*1))
	local max = ((level/5)+(maglevel*2))
	return -min, -max
end

setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local area = createCombatArea(AREA_WAVE4, AREADIAGONAL_WAVE4)
setCombatArea(combat, area)

function onTargetTitle(cid, pos)
	return elementalSpell.onSpellTargetTile.SPELL_TYPE_ICE(cid, pos)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETTILE, "onTargetTitle")

function onTargetCreature(cid, target)
	return elementalSpell.onSpellTargetCreature.SPELL_TYPE_ICE(cid, target)
end
setCombatCallback(combat, CALLBACK_PARAM_TARGETCREATURE, "onTargetCreature")

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end
